<template>
  <div style="width: 200px; height: 200px; background-color: skyblue; margin: 20px;">
son1--{{ changeCount }}
<button @click="mitt.emit('add', {money: 10})">点击son2加10</button>
<button @click="emit('update:changeCount', props.changeCount+20)">点击父亲和son1各加20</button>
  </div>
</template>

<script setup lang="ts">
// @ts-ignore
import mitt from '@/utils/bus'

const props = defineProps<{ changeCount: number }>()
const emit = defineEmits(['update:changeCount'])

</script>

<style lang="scss" scoped>

</style>